c520d0
@@ -236,8 +236,12 @@
public int read(byte[] buffer, int start, int length) throws IOException {
             } catch (DataFormatException e) {
                 throw new ZipException(e.getMessage());
             }
-            if (read == 0 && inf.finished()) {
-                return -1;
+            if (read == 0) {
+                if (inf.finished()) {
+                    return -1;
+                } else if (lengthOfLastRead == -1) {
+                    throw new IOException("Truncated ZIP file");
+                }
             }
             crc.update(buffer, start, read);
             return read;
